home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 050 / tpcmag.arc / CURSOR.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1986-05-19  |  889 b   |  34 lines

  1. program cursor;  {from October 29, 1985 PC Magazine page 217, works
  2.                   on PC/MS-dos machines only, TurboPascal v2
  3.                   }
  4.  
  5. var   top,bottom : byte;
  6.       ch         : char;
  7.  
  8. Procedure set_cursor (top,bottom : byte; curon : boolean);
  9.  
  10. var    vport : integer;
  11.  
  12. begin
  13.   vport := memw[$0040:$0063];
  14.   if not curon then top := top or 32;
  15.   port[vport] := 10;  port[vport+1] := top;
  16.   port[vport] := 11;  port[vport+1] := bottom
  17. end; { procedure set_cursor (top,bottom : byte; curon : boolean); }
  18.  
  19. begin
  20.   write('Do you want the cursor to disappear?(y/n): ');
  21.   read(ch);
  22.   writeln;
  23.   if ch in ['N', 'n']
  24.   then begin
  25.     write('Enter top line of cursor (0-13): ');
  26.     readln(top);
  27.     write('Enter bottom line of cursor (0-13): ');
  28.     readln(bottom);
  29.     set_cursor(top,bottom,true)
  30.   end
  31.   else set_cursor(top,bottom,false)
  32.  
  33. end.
  34.